<!DOCTYPE html>
<html lang="zh">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Full-Stack 系统后台管理</title>
    <!-- 后台通用 css -->
    <#include "public/public_css.ftl">
</head>

<body>

<div id="wrapper">
<#-- s 导航 -->
<#include "public/nav.ftl">
<#-- e 导航 -->

<#-- s 页面内容 -->
    <div id="page-wrapper">
        <div class=".container-fluid">
            <div class="row">
                <div class="col-md-6">
                    <form id="id_form">
                        <div class="form-group row">
                            <label for="id_ori_pwd" class="col-sm-3 col-form-label">原密码</label>
                            <div class="col-sm-8">
                                <input name="oriPwd" type="password" class="form-control" id="id_ori_pwd">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="id_new_pwd" class="col-sm-3 col-form-label">新密码</label>
                            <div class="col-sm-8">
                                <input name="newPwd" type="password" class="form-control" id="id_new_pwd">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="id_confirm_pwd" class="col-sm-3 col-form-label">确认密码</label>
                            <div class="col-sm-8">
                                <input name="confirmPwd" type="password" class="form-control" id="id_confirm_pwd">
                            </div>
                        </div>
                    </form>
                    <div class="col-md-6">
                    <button id="id_btn_submit"  class="btn btn-primary float-right">确认修改</button>
                    <a  href="/admin/home" class="btn btn-primary float-right">取消返回</a>
                    </div>
                </div>
            </div>
        </div>

    </div>
<#-- e 页面内容 -->

</div>

<#-- 后台通用 js -->
<#include "public/public_js.ftl">
</body>
<script>
    // jQuery
    $(function () {
        $("#id_btn_submit").bind("click", function () {
                 var strdata = $("#id_form").serializeArray();
                 var obj={};//给obj分配内存
                 for(var i =0;i<strdata.length;i++)
                 {
                    obj[strdata[i].name]=strdata[i]['value'];
                 }
                $.ajax({
                    type: "POST",
                    url: "/admin/updpwdAction",
                    dataType:"json",
                    contentType: "application/json;charset=utf-8",
                    data: JSON.stringify(obj),
                    success: function(data){
                        console.log(data.resultCode)
                        if(data.resultCode=="200"){
                            var ops = {
                                msg: "修改成功",
                            };
                            Modal.alert(ops);
                        }else {
                            var ops = {
                                msg: data.resultMessage,
                            };
                            Modal.alert(ops);
                        }

                        // $(location).attr('href', '/admin/title');
                    },
                    error: function(){

                    }
                });

            })
    });

</script>
</html>

<style>
    #page-wrapper {
        padding: 15px 15px;
    }
</style>